<extend name="index::index" />
<block name="title"><title>detail</title></block>
<block name="nav">
	<ul class="list-unstyled list">
		<empty name="login">
			<li>
			<a href="{:U('login')}" class="anchorLink"><i class="icon-road scolor"></i>登录</a>
			</li>
			<li>
			<a href="{:U('reg')}" class="anchorLink"><i class="icon-road scolor"></i>注册</a>
			</li>
			<else />
			<li>
			<a href="{:U('User/index',['id'=>$login['id']])}" style="text-transform:none;"><i class="icon-road scolor"></i><span style="color:#fff;">欢迎{$login['name']}</span></a>
			</li>
			<li>
			<a href="{:U('loginout')}" class="anchorLink"><i class="icon-road scolor"></i>退出</a>
			</li>
		</empty>
		<li><a href="{:U('index')}" class="anchorLink"><i class="icon-home scolor"></i>主页</a></li>
	</ul>
</block>
<block name="addver">
	<div class="carousel-inner">
		<img src="__ROOT__{$list['giname']}" width="300px" height="410px"  alt="" style="display:block;margin-top:20px;margin-left:200px; float:left;">
		<div style="width:300px;margin-left:550px;margin-top:25px;">
			<form action="{:U('Order/cart',['id'=>$list['gid']])}" method="post"> 
				<span style="font-size:18px;">商品名:{$list['gname']}</span>
				<h2>￥:<span style="color:red;" >{$list['gp']}</span></h2>
				<span style="font-size:18px;">样式:</span>
				<br/>
				&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<img src="__ROOT__{$list['giname']}" width="70px" height="70px"  alt="" >
				<br/>
				<br/>
				<span style="font-size:18px;">分类:{$list['cname']}</span>
				<br/>
				<br/>
				<span style="font-size:18px;">库存:<input type="text" name="gk" value="{$list['gk']}"  style="width:50px;" readonly/></span>
				<br/>
				<br/>
				<button onclick="return false" style="width:100px;height:40px;border:none;background:#00A5A5;">购买数量:</button>
				<button onclick="return plus()" style="width:40px;height:40px;border:none;background:#ccc;">-</button>
				<input id="num" name="num" style="width:40px;height:40px;" type="text" value="1">
				<button onclick="return minus()"  style="width:40px;height:40px;border:none;background:#ccc;">+</button>
				<br/>
				<br/>
				<button type="submit" style="width:200px;height:40px;border:none;background:#DB453E;">加入购物车</button>
				
			</form>	
				<script>
					//jian
					function plus(){
						var num = document.getElementById('num');
						num1=parseInt(num.value)-1;
						if(num1<=0)
						{
							num1=1;
						}
						num.value=num1;
						return false;
					}
					function minus(){
						var num = document.getElementById('num');
						num1=parseInt(num.value)+1;
						num.value=num1;
						return false;
					}
				</script>
		</div>
	</div>
</block>


